﻿
Imports System.ComponentModel
Imports FountainHead.Model

Namespace Controls

    Public Class Terminal
        Implements INotifyPropertyChanged

        Public Sub New()

        End Sub
        Public Sub New(ByVal ctrl As BaseControl, ByVal p As Point, ByVal isInput As Boolean)
            pointValue = p
            controlValue = ctrl
            isInputValue = isInput
        End Sub

        Public Sub New(ByVal x As Integer, ByVal y As Integer)
            pointValue = New Point(x, y)
        End Sub

        Private isInputValue As Boolean
        Public ReadOnly Property isInputTerminal As Boolean
            Get
                Return isInputValue
            End Get
        End Property

        Private controlValue As BaseControl
        Public ReadOnly Property Control As BaseControl
            Get
                Return controlValue
            End Get
        End Property

        Private pointValue As Point
        Public Property Point As Point
            Get
                Return Point.Add(pointValue, New Size(Control.Left, Control.Top))
            End Get
            Set(ByVal value As Point)
                pointValue = value
                RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs("Point"))
            End Set
        End Property

        Private currentValue As Current
        Public Property Current As Current
            Get
                Return currentValue
            End Get
            Set(ByVal value As Current)
                currentValue = value
                RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs("Current"))
            End Set
        End Property
        Public Event PropertyChanged(ByVal sender As Object, ByVal e As PropertyChangedEventArgs) Implements INotifyPropertyChanged.PropertyChanged

    End Class
End Namespace